package pl.diagnoser.client.tools;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Set;

import pl.diagnoser.client.dto.AppDTO;
import pl.diagnoser.client.dto.AttributeDictDTO;
import pl.diagnoser.client.dto.AttributeValuesDictDTO;
import pl.diagnoser.client.dto.DefectDictDTO;
import pl.diagnoser.client.dto.DiagnoserResultDTO;
import pl.diagnoser.client.dto.DiagnoserResultsDTO;
import pl.diagnoser.client.dto.EstimateDTO;
import pl.diagnoser.client.dto.ObjectHistoryViewer;
import pl.diagnoser.client.dto.SearchResultAttributesDTO;
import pl.diagnoser.client.dto.SearchResultDTO;
import pl.diagnoser.client.dto.SymptomDTO;
import pl.diagnoser.client.dto.SymptomDictDTO;
import pl.diagnoser.client.dto.UserDTO;
import pl.diagnoser.client.dto.ObjectAttributesDTO;
import pl.diagnoser.client.dto.ObjectsDTO;
import pl.diagnoser.client.formulas.DiagnoserHBFormula;
import pl.diagnoser.client.formulas.DiagnoserIFormula;
import pl.diagnoser.client.formulas.DiagnoserSFormula;
import pl.diagnoser.client.formulas.DiagnoserVFormula;

import com.google.gwt.user.client.rpc.AsyncCallback;

public interface DataGetterServiceAsync {
	
	void getListOfAllObjects( AsyncCallback<List<ObjectsDTO>> callback );
	void saveNewObject(String objectName, String objectDate, HashMap<String, String> objectAttributes, HashMap<String, List<String>> objectMultipleAttributes, AsyncCallback<Long> callback);
	void getPossibleDefects( List<SearchObjectAttribute> searchCriteria, List<SearchObjectAttribute> emptySearchCriteria, boolean fast, AsyncCallback<List<DiagnoserResultDTO>> callback );
	void getPossibleDefects( ObjectsDTO object, List<SymptomDTO> symptoms, AsyncCallback<List<DefectDictDTO>> callback );
	void getWidgetTitle( String widgetName, AsyncCallback<String> callback );
	void getLearnResult( Integer mode, Double slider, AsyncCallback<List<DiagnoserResultsDTO>> callback );
	void getHBFormulas( AsyncCallback<List<DiagnoserHBFormula>> callback );
	void getVFormulas( AsyncCallback<List<DiagnoserVFormula>> callback );
	void getSFormulas( AsyncCallback<List<DiagnoserSFormula>> callback );
	void getIFormulas( AsyncCallback<List<DiagnoserIFormula>> callback );
	void saveImplication( List<String> implications, AsyncCallback<String> callback );
	void getAttributeList( boolean loadValues, AsyncCallback<List<AttributeDictDTO>> callback );
	void getAttributeValuesList( AsyncCallback<List<AttributeValuesDictDTO>> callback );
	void saveAttribute( String attribute, int isDate, int isMultiple, int isFile, AsyncCallback<String> callback );
	void removeAttribute( String attribute, AsyncCallback<String> callback );
	void saveAttributeValue( String attribute, String attributeValue, AsyncCallback<String> callback );
	void removeAttributeValue( String attribute, String attributeValue, AsyncCallback<String> callback );
	void getObjectAttributes( Long objectId, AsyncCallback<Set<ObjectAttributesDTO>> callback );
	void getUser( String login, String password, AsyncCallback<UserDTO> callback );
	void getUserList( AsyncCallback<List<UserDTO>> callback );
	void saveUser(UserDTO user, AsyncCallback<String> callback);
	void removeUser(long userID, AsyncCallback<String> callback);
	void getAttributeValue(String attributeName, AsyncCallback<ArrayList<String>> callback);
	void saveSearching(List<SearchObjectAttribute> objectAttributes, long objectId, AsyncCallback<String> callback);
	void getSearchResultForObject(long objectId, AsyncCallback<List<SearchResultDTO>> callback);
	void getHistorySearchAttributes(long objectId, AsyncCallback<List<SearchResultAttributesDTO>> callback);
	void openPdfFile(String fileName, AsyncCallback<String> callback);
	void getWebPageForArticle(String article, AsyncCallback<String> callback);
	
	//////
	void getEstimateForObject( Long id, AsyncCallback<List<ObjectHistoryViewer>> callback );
	void getSymptomsList( AsyncCallback<List<SymptomDictDTO>> callback );
	void getDefectsList( AsyncCallback<List<DefectDictDTO>> callback );
	void saveDefect( String newValue, AsyncCallback<String> callback );
    void saveSymptom( String newValue, AsyncCallback<String> callback );
    void removeDefects( List<String> defects, AsyncCallback<String> callback );
    void removeSymptoms( List<String> symptoms, AsyncCallback<String> callback );
    void saveNewEstimate( EstimateDTO estimate, List<SymptomDTO> symptoms, AsyncCallback<Boolean> callback );
    void getAllApp( AsyncCallback<List<AppDTO>> callback );
    void updateApp( Long appID, int isActive, String appName, int isSearchMode, AsyncCallback<String> callback );
    void removeApp( String appName, AsyncCallback<String> callback );
    void getHibernateConfig( AsyncCallback<String> callback );
}
